package com.wrx.constants.generatesql;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @date: 2018/12/10
 * @description: 常量
 */
public class ConstantsCovert {
    private static final Map<List<String>, String> POINT_UNIT_MAPPING = new LinkedHashMap<>();

    private static final Map<List<String>, String> STATUS_MAPPING = new LinkedHashMap<>();

    public static final Map<List<String>, String> WORD_MAPPING = new LinkedHashMap<>();

    public static final Map<List<String>, Boolean> WORD_DEVICE_MAPPING = new LinkedHashMap<>();

    static {
        WORD_DEVICE_MAPPING.put(Arrays.asList("泵","阀","机"), true);
//        WORD_DEVICE_MAPPING.put(Arrays.asList("加氯机","搅拌机","主机","辅机","刮泥机","电机","排泥机"), true);
    }

    static {
        POINT_UNIT_MAPPING.put(Arrays.asList("压力"), "MPa");
        POINT_UNIT_MAPPING.put(Arrays.asList("电流"), "A");
        POINT_UNIT_MAPPING.put(Arrays.asList("温度"), "℃");
        POINT_UNIT_MAPPING.put(Arrays.asList("频率"), "Hz");
        POINT_UNIT_MAPPING.put(Arrays.asList("功率"), "kW");
        POINT_UNIT_MAPPING.put(Arrays.asList("能耗", "电能", "电量"), "kW·h");
        POINT_UNIT_MAPPING.put(Arrays.asList("浊度"), "NTU");
        POINT_UNIT_MAPPING.put(Arrays.asList("瞬时流量", "流量"), "m³/h");
        POINT_UNIT_MAPPING.put(Arrays.asList("累计流量", "水量"), "m³");
        POINT_UNIT_MAPPING.put(Arrays.asList("余氯"), "mg/L");
        POINT_UNIT_MAPPING.put(Arrays.asList("速度", "液位"), "m");
        POINT_UNIT_MAPPING.put(Arrays.asList("速度给定"), "L/h");
        POINT_UNIT_MAPPING.put(Arrays.asList("流速"), "m/s");
        POINT_UNIT_MAPPING.put(Arrays.asList("电导率"), "μS/cm");
        POINT_UNIT_MAPPING.put(Arrays.asList("电压"), "V");
    }

    static {
        // 状态类型映射
        STATUS_MAPPING.put(Arrays.asList("远程"), " REMOTE NULL");
        STATUS_MAPPING.put(Arrays.asList("故障"), " FAILURE NULL");
        STATUS_MAPPING.put(Arrays.asList("开到位"), " SWITCH_ON NULL");
        STATUS_MAPPING.put(Arrays.asList("关到位", "阀关控制"), " SWITCH_OFF NULL");
        STATUS_MAPPING.put(Arrays.asList("手自动"), " AUTO NULL");
        STATUS_MAPPING.put(Arrays.asList("运行"), " RUN NULL");
        // 控制类型映射
        STATUS_MAPPING.put(Arrays.asList("手动", "上位关阀", "上位开阀", "close", "open", "stop", "设置", "启动"),
                " CONTROL {\"0\":\"停止\",\"1\":\"启动\"}");
        STATUS_MAPPING.put(Arrays.asList("切换模式"),
                " CONTROL {\"0\":\"工频模式\",\"1\":\"变频模式\"}");
        STATUS_MAPPING.put(Arrays.asList("投入"),
                " CONTROL {\"0\":\"未投入\",\"1\":\"投入\"}");
        STATUS_MAPPING.put(Arrays.asList("阀-开", "阀-关", "开阀", "关阀", "停阀"),
                " CONTROL {\"0\":\"不点动\",\"1\":\"点动\"}");
    }

    static {
        WORD_MAPPING.put(Arrays.asList("泵"), "PUMP");
    }

}
